STEP 6: Sourcing in the randomGroovoid Static Method

This example makes use of randomGroovoid in exactly the same way as the previous example, except that in this case we are relying on the fact that randomGroovoid is defined as a static method in the Music Object extension file "music-object-x-dynamic.js".

Try reloading this page several times. It should behave in exactly the same way as the previous example where the randomGroovoid function was explicitly pasted into the HTML document. The JavaScript is shown in the source code listing below. Once again, place this JavaScript towards the end of your HTML file, in the spot where you'd like the random Groovoid to be embedded. Follow the same guidelines for using the randomGroovoid function as outlined in the previous example.

Copy-and-Paste
<SCRIPT SRC="music-object.js"></SCRIPT>
<SCRIPT SRC="music-object-x-dynamic.js"></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //

Music.magicEmbed (
   'SRC="stub.rmf" ' +
   'GROOVOID="' + Music.randomGroovoid ('Background-') + '" ' +
   'AUTOSTART=TRUE ' +
   'DISPLAY=SONG ' +
   'MODE=INFO ' +
   'LOOP=TRUE ' +
   'VOLUME=100'
);

// --></SCRIPT>